<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<%@ taglib prefix="tfn" uri="http://www.totoro.com/functions" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<!--
评论细节，
2021/5/14
-->
<html>
<head>
    <title>Title</title>
    <style>
        body{
            font-family: tahoma,arial,微软雅黑,sans-serif;
            font-size: 12px;
        }
    </style>
</head>
<body>
<div class="tm-rate">
    <div class="rate-header rate-header-tags" style="display: block">
        <input type="hidden" value="${product.id}" id="pid">
        <div class="rate-score">
            <h4>与描述相符</h4>
            <strong><fmt:formatNumber value="${babyStar}" type="currency" pattern=".0"/></strong>
            <div id="test3"></div>
            <script>
                layui.use(['rate'], function() {
                    var rate = layui.rate;
                    rate.render({
                        elem: '#test3'
                        , value: ${babyStar} //初始值
                        , half: true //开启半星
                        , readonly: true
                    })
                });
            </script>
            <style>
                .layui-rate{
                    padding: 0 !important;
                }
                .layui-rate li i.layui-icon {
                    font-size: 10px;
                    color: #FFB800;
                     margin-right: 0px;
                    transition: all .3s;
                    -webkit-transition: all .3s;
                }
            </style>
        </div>
        <!-- 评论分数或者评论字符，如果评论较多相同的字符，将会显示rate-tag-box。否则rate-graph-->

        <!-- rate-tag-box start -->
        <div class="rate-tag-box" style="display: none">
            <div class="rate-tag-label">
                <span>大家都写到</span>
            </div>
            <div class="rate-tag-list" style="height: 70px;">
                <div class="rate-tag-inner">
                    <span class="tag-posi">
                        <a href="#">
                            很可恶(90)
                            <s></s>
                            </a>
                    </span>
                </div>
            </div>
        </div>
        <!-- rate-tag-box end -->

        <!-- rate-graph start -->
        <div class="rate-graph">
            <div class="graph-scroller">
            <span style="width:${babyStar =='NaN'?'100':babyStar*20}%">
            <em>${babyStar =='NaN'?'无分':babyStar}</em>
        </span>
            </div>
            <ol class="graph-desc">
                <li>非常不满</li>
                <li>不满意</li>
                <li>一般</li>
                <li>满意</li>
                <li>非常满意</li>
            </ol>
        </div>
        <!-- rate-graph end -->
    </div>


    <!-- -------------------- -->
    <!-- 过滤按钮 -->
    <div class="rate-toolbar">
        <span class="rate-filter">
            <input type="radio" class="rate-list-all rate-radio-group" checked="" name="radiogroup" value="0">
            <label>全部</label>
            <input type="radio" class="rate-list-append rate-radio-group" name="radiogroup" value="1">
            <label>追评 (${appendEvaLength})</label>
            <input type="radio" class="rate-list-picture rate-radio-group" name="radiogroup" value="2">
            <label>图片 (${imageEvaLength})</label>
        </span>
        <span class="tm-toolbar-lft">
            <input class="rate-list-hascontent" type="checkbox" checked="">
            <label>有内容</label>
            <div class="rate-sort">
                <div class="tm-selectbtn tm-rate-sort">
                    <span class="tm-r-current tm-current on-default">按默认</span>
                    <ul>
                        <li class="tm-r-default">
                            <a>按默认</a>
                        </li>

                        <li class="tm-r-time">
                            <a>
                                按时间
                            </a>
                        </li>
                    </ul>
                </div>
            </div>
        </span>
    </div>
    <!-- 过滤按钮 👆-->

    <!-- 评论 start -->

    <input type="hidden" id="defaultEvaCount" value="${fn:length(productComments)}">
    <div class="rate-grid">
        <table style="    font-size: 12px;">
            <tbody>

            <!-- 评论细节，循环此处(循环时记得删除该注释) -->
            <c:forEach items="${productComments}" var="productComment" varStatus="vs">
                <tr>
                    <td class="tm-col-master">
                        <!-- 初次评价 -->
                        <div class="tm-rate-premiere">
                        <div class="tm-rate-tag">
                            <div class="tm-rate-title">初次评价:</div>
                            <div class="tm-rate-date">${tfn:formatDateByString(productComment.createTime)}</div>
                        </div>
                        <div class="tm-rate-content">
                            <div class="tm-rate-fulltxt">
                                ${productComment.commentText}
                            </div>
                            <div class="tm-m-photos">
                                <ul class="tm-m-photos-thumb" data-rate-type="tm-rate-premiere">
                                    <%-- foreach image --%>
                                    <c:forEach items="${productComment.commentImageList}" var="commentImage" varStatus="vs2">
                                        <li>
                                            <img src="${commentImage.imagePath}">
                                            <b class="tm-photos-arrow"></b>
                                        </li>
                                    </c:forEach>
                                </ul>
                                <div class="tm-m-photo-viewer" style="width: 0px; height: 0px; display: none">
                                    <img src="not!" style="width: 302px; height: 402px;">
                                    <a class="tm-m-photo-viewer-navleft" style="width: 100.667px; cursor:default;">
                                        <i class="tm-m-photo-viewer-navicon iconfont icon-zuojiantou" style="top:193px; display: none; font-size: 40px; font-weight: 700;"></i>
                                    </a>
                                    <a class="tm-m-photo-viewer-navright" style="width: 100.667px; cursor:pointer;">
                                        <i class="tm-m-photo-viewer-navicon iconfont icon-youjiantou" style="top: 193px; display: none;  font-size: 40px; font-weight: 700;"></i>
                                    </a>
                                </div>
                            </div>
                        </div>
                        </div>
                        <!-- ----------------------------------------------->
                        <!-- 再次评价 -->
                        <div class="tm-rate-append">
                            <c:if test="${productComment.marketSrOrder.isAppendComment == 1}">
                            <div class="tm-rate-tag">
                                <div class="tm-rate-title">
                                    <c:set var="day" value="${tfn:timeDifferenceDay(productComment.receiptDate, productComment.appendComment.createTime)}"></c:set>
                                    <span class="tm-rate-daydiff">${day=="0"?"收货当天追加：":"收货"+=day+="天后追加："}</span>
                                </div>
                                <div class="tm-rate-date"></div>
                            </div>
                            <div class="tm-rate-content">
                                <div class="tm-rate-fulltxt">${productComment.appendComment.text}</div>
                                <div class="tm-m-photos">
                                    <ul class="tm-m-photos-thumb" data-rate-type="tm-rate-append">
                                        <c:forEach items="${productComment.appendComment.acImages}" var="acImage" varStatus="acVs">
                                            <li class="">
                                                <img src="${acImage.acImagePath}">
                                                <b class="tm-photos-arrow"></b>
                                            </li>
                                        </c:forEach>
                                    </ul><div class="tm-m-photo-viewer" style="width: 0px; height: 0px; display: none;">
                                    <img src="//img.alicdn.com/bao/uploaded/i2/2471402552/O1CN01MZsW7U1UirSEawZt6_!!2471402552-0-reviewlitetao.jpg_400x400.jpg" style="width: 194px; height: 402px;">
                                </div>
                                </div>
                            </div>
                            </c:if>
                            <c:if test="${productComment.marketSrOrder.sellerIsReply == 1}">
                            <div class="tm-rate-date" style="font-size: 12px">${tfn:formatDateByString(productComment.sellerReply.createTime)}
                            </div>
                            <!-- 该段为卖家解释字段，如果为空则不循环此处（循环时必须进行删除该住注释）  -->
                            <div class="tm-rate-reply">
                                    <div class="tm-rate-fulltxt">
                                        解释：${productComment.sellerReply.text}
                                    </div>
                            </div>
                            <s></s>
                            </c:if>
                        </div>
                        <!-- --------------------------------------------------->
                    </td>
                    <c:set var="skuData" value="${productComment.marketSrOrder.product.productSpecs.productSpaceData}"></c:set>
                    <c:set var="skuDatas" value='${fn:split(fn:replace(fn:replace(skuData, "{" , ""), "}", ""), ",")}'></c:set>
                    <td class="col-meta">
                        <div class="rate-sku">
                            <c:forEach begin="0" end="${fn:length(skuDatas)-1}" varStatus="hdVs">
                                <p class="sku-line">${fn:split(fn:replace(skuDatas[hdVs.index], "\"", ""), "|")[0]}</p>
                            </c:forEach>
                        </div>
                    </td>
                    <td class="col-author">
                        <%-- 判断用户是否匿名 --%>
                        <div class="rate-user-info">
                            <c:if test="${productComment.isAnOnyMouse == 1}" var="isAom">
                                <span>${tfn:cipheretext(productComment.user.userName)}</span>
                                <span>(匿名)</span>
                            </c:if>
                            <c:if test="${!isAom}">
                                <span>${productComment.user.userName}</span>
                            </c:if>
                        </div>
                        <div class="rate-user-grade">
                            <p class="gold-user" style="display: block">天猫会员</p>
                        </div>
                    </td>
                </tr>
            </c:forEach>
            <!-- 上面为评论细节，循环此处(循环时记得删除该注释) -->
                <c:if test="${fn:length(productComments) < 1}">
                    <p style="text-align: center; font-size: 19px">暂无数据</p>
                </c:if>
            </tbody>
        </table>
    </div>
    <!-- 评论分页 -->
    <div class="search-page">
        <input type="hidden" id="allCount" value="${allCount}"/>
        <div id="searchPagination"></div>
    </div>
    <style>
        .search-page a, .search-page span {
            font-family: \5B8B\4F53,Helvetica,sans-serif;
        }
        .layui-laypage {
            padding-top: 19px;
            background: url() left 0 no-repeat;
        }
        .layui-laypage-prev.layui-disabled{
            background-color: #EFEFEF;
        }
        .layui-laypage-next.layui-disabled{
            background-color: #EFEFEF;
        }
        .search-page a, .search-page span{
            font-size: 14px;
            font-weight: 700;
            height: 40px;
            line-height: 40px;
        }
        .search-page a:hover, .layui-laypage button:hover{
            background-color: #EFEFEF;
        }
        .layui-laypage .layui-laypage-curr .layui-laypage-em{
            background-color: #EFEFEF;
            top:0;
            padding: 0;
            left: 0;
        }
        .layui-laypage .layui-laypage-curr em{
            color: #999;
        }

        .layui-laypage a, .layui-laypage span {
            color: #2953A6;
        }
        .layui-laypage a, .layui-laypage .layui-laypage-curr, .layui-laypage button, .layui-laypage input, .layui-laypage select, .layui-laypage span{
            border: 1px solid #E5E5E5;
        }
    </style>
    <!-------------->

    <!-- 评论 end -->


</div>
</body>
<script>
    $(function () {

        // 默认分页
        $(document).ready(function () {
            layui.use(['laypage', 'layer'], function() {
                var laypage = layui.laypage
                    , layer = layui.layer;
                laypage.render({
                    elem: 'searchPagination'
                    ,count: $("#defaultEvaCount").val()
                    ,limit: 15
                    ,curr: Totoro.getQueryVariable("evaCurr")
                    ,groups: 3
                    ,layout: ['count', 'prev', 'page', 'next', 'skip']
                    ,jump: function(obj, first){
                        //首次不执行
                        if(!first){
                            var newUrl = Totoro.changeURLPar(window.location.href, "curr", obj.curr);
                            // window.location.href = newUrl;
                        }
                    }
                });
            });
        })


                // 按默认 按时间排序选择事件
                $(".tm-current").mouseover(function () {
                $(".tm-selectbtn ul").show();
                });
                $(".tm-current").mouseout(function () {
                $(".tm-selectbtn ul").hide();
                });

                $(".tm-selectbtn ul").mouseenter(function () {
                $(this).show();
                });

                $(".tm-selectbtn ul").mouseleave(function () {
                $(this).hide();
                });

                $(".tm-r-default").click(function () {
                if($(".tm-r-current").text()!="按默认"){
                $(".tm-r-current").text("按默认");
                generateEve();
                }
                $(".tm-selectbtn ul").hide();
                });

                $(".tm-r-time").click(function () {
                if ($(".tm-r-current").text() != "按时间") {
                $(".tm-r-current").text("按时间");
                generateEve();
                }
                $(".tm-selectbtn ul").hide();
                });


                // 评论商品图片点击放大事件
                $(".rate-grid").on("click", ".tm-m-photos-thumb li", function() {
                // 如果是选中放大状态，取消并缩小
                var parentNick = $(this).parent().attr("data-rate-type");
                var $parent = $(this).parents("."+parentNick);

                if($(this).attr("class") == "tm-current"){
                $(this).removeClass("tm-current");
                $parent.find(".tm-m-photo-viewer").hide().css({width: "0px", height: "0px"});
                $(this).find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1nTBDFCRbXXbzTk_b-25-20.png),url(//assets.alicdn.com/img/common/zoom_in.cur),auto");
                } else {
                $imgLi = $(this);
                $(this).addClass("tm-current").siblings().removeClass("tm-current");
                // 点击任何li ， 放大图片，显示div
                $parent.find(".tm-m-photo-viewer").show().animate({width: "302px", height: "402px"});
                $parent.find(".tm-m-photo-viewer img").prop("src", $(this).find("img").attr("src"));
                // 图片缩小图片
                $(this).find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1oq4AFupvXXcu5FDa-20-20.png),url(//assets.alicdn.com/img/common/zoom_out.cur),auto");
                $(this).siblings().find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1nTBDFCRbXXbzTk_b-25-20.png),url(//assets.alicdn.com/img/common/zoom_in.cur),auto");
                }
                })


                // 等待
                // $(".tm-m-photo-viewer img").click(function () {
                //
                // })

                // 鼠标悬浮评论大图片，显示隐藏箭头
                $(".rate-grid").on("mouseover", ".tm-m-photo-viewer-navleft", function() {
                var $ImageUl = $(this).parents(".tm-m-photo-viewer").prev();
                // 获取当前选中li，判断是否为所有li当中的第一个，如果是，不显示该i标签
                var $allLi = $ImageUl.find("li");
                var $nowLi = $ImageUl.find("li.tm-current");
                var index = $allLi.index($nowLi);
                if(index!=0) {
                $(this).find("i").css("display", "inline");
                }
                });

                $(".rate-grid").on("mouseout", ".tm-m-photo-viewer-navleft", function() {
                $(this).find("i").css("display","none");
                });

                // 鼠标悬浮评论大图片，显示隐藏箭头
                $(".rate-grid").on("mouseover", ".tm-m-photo-viewer-navright", function() {
                var $ImageUl = $(this).parents(".tm-m-photo-viewer").prev();
                var $allLi = $ImageUl.find("li");
                var $nowLi = $ImageUl.find("li.tm-current");
                var index = $allLi.index($nowLi);
                if(index!=$allLi.length-1) {
                $(this).find("i").css("display", "inline");
                } else{
                $(this).css("cursor","default");
                }
                });
                $(".rate-grid").on("mouseout", ".tm-m-photo-viewer-navright", function() {
                $(this).find("i").css("display","none");
                });


                /**
                * 点击评论图片悬浮的左右箭头切换图片
                */
                $(".rate-grid").on("click", ".tm-m-photo-viewer-navleft i", function() {
                var $ImageUl = $(this).parents(".tm-m-photo-viewer").prev();
                var $allLi = $ImageUl.find("li");
                // 获取当前选中的li
                var $nowLi = $ImageUl.find("li.tm-current");
                // 如果当前是第一个，继续隐藏左箭头
                var index = $allLi.index($nowLi);
                if(index == 1){
                $(this).css("display","none");
                }
                $nowLi.prev().addClass("tm-current").siblings().removeClass("tm-current");
                $(this).parents(".tm-m-photo-viewer").find("img").prop("src", $nowLi.prev().find("img").attr("src"));
                // 给小图片更换缩小状态
                $nowLi.prev().find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1oq4AFupvXXcu5FDa-20-20.png),url(//assets.alicdn.com/img/common/zoom_out.cur),auto")
                $nowLi.prev().siblings().find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1nTBDFCRbXXbzTk_b-25-20.png),url(//assets.alicdn.com/img/common/zoom_in.cur),auto");
                })
                // $(".tm-m-photo-viewer-navleft i").click(function () {
                //
                // });

                $(".rate-grid").on("click", ".tm-m-photo-viewer-navright i", function() {
                var $ImageUl = $(this).parents(".tm-m-photo-viewer").prev();
                var $allLi = $ImageUl.find("li");
                // 获取当前选中的li
                var $nowLi = $ImageUl.find("li.tm-current");
                // 如果当前是第最后一个，继续隐藏左箭头
                var index = $allLi.index($nowLi);
                console.log(index)
                if(index == $allLi.length-2){
                $(this).css("display","none");
                $(this).parent().css("cursor","default");
                }
                $nowLi.next().addClass("tm-current").siblings().removeClass("tm-current");
                $(this).parents(".tm-m-photo-viewer").find("img").prop("src", $nowLi.next().find("img").attr("src")).css("cursor", "url(//img.alicdn.com/tps/i1/T1oq4AFupvXXcu5FDa-20-20.png),url(//assets.alicdn.com/img/common/zoom_out.cur),auto");
                // 给小图片更换缩小状态
                $nowLi.next().find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1oq4AFupvXXcu5FDa-20-20.png),url(//assets.alicdn.com/img/common/zoom_out.cur),auto")
                $nowLi.next().siblings().find("img").css("cursor", "url(//img.alicdn.com/tps/i1/T1nTBDFCRbXXbzTk_b-25-20.png),url(//assets.alicdn.com/img/common/zoom_in.cur),auto");
                })

                // $(".tm-m-photo-viewer-navright i").click(function () {
                //
                // });


                // 点击全部 追评 图片，按默认 按时间，动态生成
                $(".rate-radio-group").change(function () {
                generateEve();
                });

                function generateEve() {
                var $commentBox = $(".rate-grid table tbody");
                $commentBox.html("");
                var type = $(".rate-radio-group:checked").val();
                var sort = $(".tm-r-current").text()=="按默认"?"default":"date";
                // var haveContent = $(".rate-list-hascontent");
                // var onDefault = $(".on-default")
                $.post("/productBuy_logic/findTypeComment.htm", {"pid":$("#pid").val(), "type": type, "sort": sort, }, function (res) {
                var ejs = eval("(" + res +")");
                console.log(ejs);


                    layui.use(['laypage', 'layer'], function() {
                        var laypage = layui.laypage
                            , layer = layui.layer;
                        laypage.render({
                            elem: 'searchPagination'
                            ,count: ejs.length
                            ,limit: 15
                            ,curr: Totoro.getQueryVariable("evaCurr")
                            ,groups: 3
                            ,layout: ['count', 'prev', 'page', 'next', 'skip']
                            ,jump: function(obj, first){
                                //首次不执行
                                if(!first){
                                    var newUrl = Totoro.changeURLPar(window.location.href, "evaCurr", obj.curr);
                                    window.history.pushState(null,null,newUrl);//向当前url添加参数
                                }
                            }
                        });
                    });



                for (let i = 0; i < ejs.length; i++) {
                var commentText = ejs[i]['commentText'];
                var firstTime = new Date(ejs[i]['createTime']).format("yyyy-MM-dd");
                var isAnOnyMouse = ejs[i]['isAnOnyMouse'];
                var userName = ejs[i]['user']['userName'];
                var sku = ejs[i]['marketSrOrder']['product']['productSpecs']['productSpaceData'];
                var skus = (sku.replaceAll("{", "").replaceAll("}", "").replaceAll("'", "")).split(",");
                var images = ejs[i]['commentImageList'];
                var day = Totoro.getDaysBetween(ejs[i]['receiptDate'], ejs[i]['appendComment']['createTime']);
                var appendText = ejs[i]['appendComment']['text'];
                var $eva = $("<tr>" +
                " <td class='tm-col-master'>" +
                " <!-- 初次评价 -->\n" +
                "                        <div class='tm-rate-premiere'>\n" +
                "                        <div class='tm-rate-tag'>\n" +
                "                            <div class='tm-rate-title'>初次评价:</div>\n" +
                "                            <div class='tm-rate-date'>"+firstTime+"</div>\n" +
                "                        </div>\n" +
                "                        <div class='tm-rate-content'>\n" +
                "                            <div class='tm-rate-fulltxt'>\n" +
                "                                "+commentText+"\n" +
                "                            </div>\n" +
                "                            <div class='tm-m-photos'>\n" +
                "                               <ul class='tm-m-photos-thumb' data-rate-type='tm-rate-premiere'>\n" +
                "                               " +
                "                               </ul>\n"+
                "                                <div class='tm-m-photo-viewer' style='width: 0px; height: 0px; display: none'>\n" +
                "                                    <img src='not!' style='width: 302px; height: 402px;'>\n" +
                "                                    <a class='tm-m-photo-viewer-navleft' style='width: 100.667px; cursor:default;'>\n" +
                "                                        <i class='tm-m-photo-viewer-navicon iconfont icon-zuojiantou' style='top:193px; display: none; font-size: 40px; font-weight: 700;'></i>\n" +
                "                                    </a>\n" +
                "                                    <a class='tm-m-photo-viewer-navright' style='width: 100.667px; cursor:pointer;'>\n" +
                "                                        <i class='tm-m-photo-viewer-navicon iconfont icon-youjiantou' style='top: 193 px; display: none;  font-size: 40px; font-weight: 700;'></i>\n" +
                "                                    </a>\n" +
                "                                </div>\n" +
                "                            </div>\n" +
                "                        </div>\n" +
                "                        </div>\n" +
                "                        <!-- ----------------------------------------------->\n" +
                "                        <!-- 再次评价 -->"+
                "                         <div class='tm-rate-append'>\n"+
                "                         </div>\n"+
                "                        <!-- --------------------------------------------------->\n" +
                "                    </td>\n" +
                "                    \n" +
                "                    \n" +
                "                    <td class='col-meta'>\n" +
                "                        <div class='rate-sku'>\n" +
                "                            \n" +
                "                        </div>\n" +
                "                    </td>\n" +
                "                    <td class='col-author'>\n" +
                "                        \n" +
                "                        <div class='rate-user-info'>\n" +
                "                            \n" +
                "                                <span>"+(isAnOnyMouse==1?Totoro.getCiphertext(userName):userName)+"</span>\n" +
                "                                <span>"+(isAnOnyMouse==1?'(匿名)':'')+"</span>\n" +
                "                            \n" +
                "                            \n" +
                "                        </div>\n" +
                "                        <div class='rate-user-grade'>\n" +
                "                            <p class='gold-user' style='display: block'>天猫会员</p>\n" +
                "                        </div>\n" +
                "                    </td>\n" +
                "                </tr>").appendTo($commentBox);

                // sku
                for (let i = 0; i < skus.length; i++) {
                $("<p class='sku-line'>"+skus[i]+"</p>").appendTo($eva.find(".rate-sku"));
                }


                var isHaveImage = parseInt(ejs[i]['isHaveImage']);
                if(isHaveImage == 1){
                // image
                for (let i = 0; i < images.length; i++) {
                $(" <li>" +
                " <img src='"+images[i]['imagePath']+"'>\n" +
                "                                            <b class='tm-photos-arrow'></b>\n" +
                "                                        </ li>").appendTo($eva.find(".tm-m-photos-thumb"));
                }
                }


                var isAppend = parseInt(ejs[i]['marketSrOrder']['isAppendComment']);
                if(isAppend == 1){
                var $append = $("<div class='tm-rate-tag'>\n" +
                "                                <div class='tm-rate-title'>\n" +
                "                                    \n" +
                "                                    <span class='tm-rate-daydiff'>"+ (day==0?'收货当天追加':'收货'+day+'天后追加')+"：</span>\n" +
                "                                </div>\n" +
                "                                <div class='tm-rate-date'></div>\n" +
                "                            </div>\n" +
                "                            <div class='tm-rate-content'>\n" +
                "                                <div class='tm-rate-fulltxt'>"+appendText+"</div>\n" +
                "                                <div class='tm-m-photos'>\n" +
                "                                    <ul class='tm-m-photos-thumb' data-rate-type='tm-rate-append'>\n" +
                "                                        \n" +
                "                                        \n" +
                "                                    </ul><div class='tm-m-photo-viewer' style='width: 0px; height: 0px; display: none;'>\n" +
                "                                    <img src='//img.alicdn.com/bao/uploaded/i2/2471402552/O1CN01MZsW7U1UirSEawZt6_!!2471402552-0-reviewlitetao.jpg_400x400.jpg' style='width: 194px; height: 402px;'>\n" +
                "                                </div>\n" +
                "                                </div>\n" +
                "                            </div>\n" +
                "                            \n" +
                "                            \n" +
                "                            <div class='tm-rate-date' style='font-size: 12px'>2021-07-26\n" +
                "                            </div>\n" +
                "                            <s></s>").appendTo($eva.find(".tm-rate-append"));


                var isHaveAppendImage = parseInt(ejs[i]['appendComment']['isHaveImage']);
                if(isHaveAppendImage == 1){
                // 追评图片
                $(" <li class=''>\n" +
                "                                                <img src='\\static\\img\\product\\evaluation\\5ecf4f10-9249-45a3-8b2b-9046ed27895dO1CN01Fh991V1WggnpJ7U1j_!!3327042818.jpg_430x430q90.jpg'>\n" +
                "                                                <b class='tm-photos-arrow'></b>\n" +
                "                                            </li>").appendTo($append.find(".tm-m-photos-thumb"));
                }
                }

                var isReply = parseInt(ejs[i]['marketSrOrder']['sellerIsReply']);
                if(isReply == 1){
                $( " <!-- 该段为卖家解释字段，如果为 循环此处（循环时必须进行删除该住注释）   -->\n" +
                "                            <div class='tm-rate-reply'>\n" +
                "                                    <div class='tm-rate-fulltxt'>\n" +
                "                                        解释：感谢您对我们的支持，找点空闲，找点时间，带上笑容，常来这看看哟。\n" +
                "                                    </div>\n" +
                "                            </div>\n").appendTo($eva.find(".tm-rate-append"));
                }
                }
                })
                }
                });

    Date.prototype.format = function(fmt) {
        var o = {
            "M+" : this.getMonth()+1,                 //月份
            "d+" : this.getDate(),                    //日
            "h+" : this.getHours(),                   //小时
            "m+" : this.getMinutes(),                 //分
            "s+" : this.getSeconds(),                 //秒
            "q+" : Math.floor((this.getMonth()+3)/3), //季度
            "S"  : this.getMilliseconds()             //毫秒
        };
        if(/(y+)/.test(fmt)) {
            fmt=fmt.replace(RegExp.$1, (this.getFullYear()+"").substr(4 - RegExp.$1.length));
        }
        for(var k in o) {
            if(new RegExp("("+ k +")").test(fmt)){
                fmt = fmt.replace(RegExp.$1, (RegExp.$1.length==1) ? (o[k]) : (("00"+ o[k]).substr((""+ o[k]).length)));
            }
        }
        return fmt;
    }
</script>
</html>
